Imports System.Windows.Forms

Public Class dlgNagscreen

    Dim nagTime As Integer = 10

    Private Sub OK_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK_Button.Click
        Me.DialogResult = System.Windows.Forms.DialogResult.OK
        Me.Dispose()
    End Sub

    Private Sub Cancel_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Me.DialogResult = System.Windows.Forms.DialogResult.Cancel
        Me.Close()
    End Sub

    Private Sub dlgRegister_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Me.nagTimer.Start()
        Me.Focus()
    End Sub

    Private Sub nagTimer_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles nagTimer.Tick
        nagTime = nagTime - 1
        Me.OK_Button.Text = "OK [" + nagTime.ToString + "]"
        If nagTime = 0 Then
            Me.nagTimer.Stop()
            Me.OK_Button.Text = "OK"
            Me.OK_Button.Enabled = True
        End If
        Me.Refresh()
    End Sub

    Private Sub LinkLabel1_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles LinkLabel1.LinkClicked
        System.Diagnostics.Process.Start("mailto:umtsconnector@singer-systems.de?subject=Registration of UMTS-Connector&body=Please%20fill%20out%20the%20following%20form.%20We%20will%20send%20you%20a%20serialnumber%20as%20soon%20as%20we%20read%20through%20your%20mail.%0A%0AName%3A%0A%0ALocation%3A%0A%0ACarrier%3A%0A%0AWhere%20did%20you%20hear%20about%20UMTS%20Connector%3A%0A%0ADo%20you%20like%20it%3F%20Why%3F%20/%20Why%20not%3F%3A")
        Me.DialogResult = System.Windows.Forms.DialogResult.OK
        Me.Dispose()
    End Sub

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        dlgNagscreen.SetWindowPos(Me.Handle, New IntPtr(Me.HWND_TOPMOST), 0, 0, 0, 0, Me.SWP_NOSIZE Or Me.SWP_NOMOVE)
    End Sub

    Private Declare Function SetWindowPos Lib "user32" _
        (ByVal hWnd As IntPtr, _
         ByVal hWndInsertAfter As IntPtr, _
         ByVal X As Integer, _
         ByVal Y As Integer, _
         ByVal cx As Integer, _
         ByVal cy As Integer, _
         ByVal uFlags As Integer) As Boolean

    Private Const HWND_TOPMOST As Integer = -1
    Private Const SWP_NOSIZE As Integer = &H1
    Private Const SWP_NOMOVE As Integer = &H2

End Class

